<template>
  <div>
    <p>最受好评电影</p>
    <div class="swiper_box">
      <SwiperSlide>
        <div class="swiper-slide bannerBox" v-for="item in movieList" :key="item.id">
          <img :src="item.img | imgfilter" />
          <p>{{ item.nm }}</p>
          <div class="score">
            <span style="padding-right:6px">观众评分</span>
            <span>{{item.sc}}</span> 
            </div>
        </div>
      </SwiperSlide>
    </div>

    <!-- 电影列表 -->
    <Nowlist :movieList="movieList"></Nowlist>
  </div>
</template>

<script>
import axios from "axios";
import SwiperSlide from "@/components/Swiper/Swiper";
import Nowlist from "@/components/Movie/Nowlist";
import Vue from "vue";
export default {
  components: {
    SwiperSlide,
    Nowlist,
  },
  data() {
    return {
      movieList: [],
    };
  },
  mounted() {

    // 正在热映网络请求

    // axios.get("/ajax/movieOnInfoList").then((res) => {
    //   console.log(res);
    //   this.movieList = res.data.movieList;
    // });


  // 正在热映本地json请求
    axios.get("/static/now.json").then((res) => {
      //console.log(res);
      this.movieList = res.data.movieList;
    });

  },
};
</script>

<style lang='scss' scoped>
p {
  font-size: 14px;
  padding: 12px 0 0 15px;
  background: white;
}
.swiper_box {
  padding: 12px 0 12px 15px;
  background: white;
  margin-bottom: 10px;
}
.bannerBox {
  width: 100%;
  height: 150px;
  font-size: 13px;
  text-align: center;
  position: relative;
  
  img {
    width: 100%;
    height: 115px;
  }
  div{
    position: absolute;
    left: 0px;
    bottom:35px;
    color: #faaf00;
    font-weight: bolder;
    width: 100%;
    font-size: 12px;
  }
}
</style>
